using Interfaces.Model;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Models
{
    /// <summary>
    /// 考勤数据模型（用于TCP传输）
    /// </summary>
    public class EmployeeData
    {
        /// <summary>
        /// 工号
        /// </summary>
        public string EmployeeId { get; set; } = string.Empty;
        /// <summary>
        /// 姓名
        /// </summary>
        public string EmployeeName { get; set; } = string.Empty;
        /// <summary>
        /// 人员类别
        /// </summary>
        public string EmployeeType { get; set; } = string.Empty;
        /// <summary>
        /// 登录时间
        /// </summary>
        public string LoginTime { get; set; } = string.Empty;
    }

    /// <summary>
    /// 员工考勤数据表实体
    /// </summary>
    public class tb_EmployeeAttendance : IDataModel
    {
        /// <summary>
        /// 自增主键
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int? iID { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        [Key]
        [MaxLength(50)]
        public string EmployeeId { get; set; } = string.Empty;

        /// <summary>
        /// 姓名
        /// </summary>
        [MaxLength(100)]
        public string EmployeeName { get; set; } = string.Empty;

        /// <summary>
        /// 人员类别
        /// </summary>
        [MaxLength(50)]
        public string EmployeeType { get; set; } = string.Empty;

        /// <summary>
        /// 登录时间（从考勤设备获取）
        /// </summary>
        public DateTime? LoginTime { get; set; }

        /// <summary>
        /// 系统接收时间
        /// </summary>
        public DateTime ReceiveTime { get; set; }

        /// <summary>
        /// 数据来源
        /// </summary>
        [MaxLength(50)]
        public string Source { get; set; } = "KaoQinMonitor";

        /// <summary>
        /// 状态
        /// </summary>
        [MaxLength(20)]
        public string Status { get; set; } = "Active";
    }
}
